package cn.ilovese.collect.datamapper.collaboration_task;

import cn.ilovese.collect.po.collaboration_task.CollaborationWork;

import java.util.List;

public interface CollaborationWorkMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(CollaborationWork record);

    int insertSelective(CollaborationWork record);

    CollaborationWork selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CollaborationWork record);

    int updateByPrimaryKey(CollaborationWork record);

    CollaborationWork selectByWorkerAndTask(Integer taskId, Integer userId);

    //ordered
    List<CollaborationWork> selectByTaskAndNotCollacatedNotCompleted(Integer downstreamId);

    //ordered
    List<CollaborationWork> selectByTaskAndNotBeenCollacatedCompleted(Integer upstreamId);

    int selectMaxGroupId(Integer taskId);

    int selectSubTaskMaxGroupId(Integer subTaskId);

    List<CollaborationWork> selectAllByParentTaskIdAndGroupId(Integer taskId,Integer groupId);

    CollaborationWork selectByParentTaskIdAndUserId(Integer taskId, Integer userId);

    int selectMaxId();
}